using the pythagorean inequality theorem